<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<title>OpenCV: cv::CommandLineParser Class Reference</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../tutorial-utils.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
   &#160;<span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../d2/d75/namespacecv.html">cv</a></li><li class="navelem"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html">CommandLineParser</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="../../d7/d52/classcv_1_1CommandLineParser-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">cv::CommandLineParser Class Reference<div class="ingroups"><a class="el" href="../../d0/de1/group__core.html">Core functionality</a> &raquo; <a class="el" href="../../db/de0/group__core__utils.html">Utility and system functions and macros</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Designed for command line parsing.  
 <a href="../../d0/d2e/classcv_1_1CommandLineParser.html#details">More...</a></p>

<p><code>#include &lt;opencv2/core/utility.hpp&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad0bb71c0bc9800e90bfdc44ff406293e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#ad0bb71c0bc9800e90bfdc44ff406293e">CommandLineParser</a> (int argc, const char *const argv[], const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;keys)</td></tr>
<tr class="memdesc:ad0bb71c0bc9800e90bfdc44ff406293e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#ad0bb71c0bc9800e90bfdc44ff406293e">More...</a><br /></td></tr>
<tr class="separator:ad0bb71c0bc9800e90bfdc44ff406293e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a614095229293b2ab780cadd41a83313a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a614095229293b2ab780cadd41a83313a">CommandLineParser</a> (const <a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html">CommandLineParser</a> &amp;parser)</td></tr>
<tr class="memdesc:a614095229293b2ab780cadd41a83313a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor.  <a href="#a614095229293b2ab780cadd41a83313a">More...</a><br /></td></tr>
<tr class="separator:a614095229293b2ab780cadd41a83313a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a92bf68d8b036aad6164d1a5ee51ded01"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a92bf68d8b036aad6164d1a5ee51ded01">~CommandLineParser</a> ()</td></tr>
<tr class="memdesc:a92bf68d8b036aad6164d1a5ee51ded01"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#a92bf68d8b036aad6164d1a5ee51ded01">More...</a><br /></td></tr>
<tr class="separator:a92bf68d8b036aad6164d1a5ee51ded01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2e11e779047efded23f75d9c5c5dd82e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a2e11e779047efded23f75d9c5c5dd82e">about</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;message)</td></tr>
<tr class="memdesc:a2e11e779047efded23f75d9c5c5dd82e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the about message.  <a href="#a2e11e779047efded23f75d9c5c5dd82e">More...</a><br /></td></tr>
<tr class="separator:a2e11e779047efded23f75d9c5c5dd82e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6b244a52f3b90da6fc463341c8a486f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#ad6b244a52f3b90da6fc463341c8a486f">check</a> () const</td></tr>
<tr class="memdesc:ad6b244a52f3b90da6fc463341c8a486f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check for parsing errors.  <a href="#ad6b244a52f3b90da6fc463341c8a486f">More...</a><br /></td></tr>
<tr class="separator:ad6b244a52f3b90da6fc463341c8a486f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a190215863579a6d244dccfd261ee0224"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a190215863579a6d244dccfd261ee0224"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a190215863579a6d244dccfd261ee0224">get</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;name, bool space_delete=true) const</td></tr>
<tr class="memdesc:a190215863579a6d244dccfd261ee0224"><td class="mdescLeft">&#160;</td><td class="mdescRight">Access arguments by name.  <a href="#a190215863579a6d244dccfd261ee0224">More...</a><br /></td></tr>
<tr class="separator:a190215863579a6d244dccfd261ee0224"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60f2b13d84edfc54aed723fb170478b9"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a60f2b13d84edfc54aed723fb170478b9"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a60f2b13d84edfc54aed723fb170478b9">get</a> (int index, bool space_delete=true) const</td></tr>
<tr class="memdesc:a60f2b13d84edfc54aed723fb170478b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Access positional arguments by index.  <a href="#a60f2b13d84edfc54aed723fb170478b9">More...</a><br /></td></tr>
<tr class="separator:a60f2b13d84edfc54aed723fb170478b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a19086a9bc59b7e3d943ea13b0a9fcb7e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a19086a9bc59b7e3d943ea13b0a9fcb7e">getPathToApplication</a> () const</td></tr>
<tr class="memdesc:a19086a9bc59b7e3d943ea13b0a9fcb7e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns application path.  <a href="#a19086a9bc59b7e3d943ea13b0a9fcb7e">More...</a><br /></td></tr>
<tr class="separator:a19086a9bc59b7e3d943ea13b0a9fcb7e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c41cf242b2ad8c0472e3b57893ef200"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a8c41cf242b2ad8c0472e3b57893ef200">has</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;name) const</td></tr>
<tr class="memdesc:a8c41cf242b2ad8c0472e3b57893ef200"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if field was provided in the command line.  <a href="#a8c41cf242b2ad8c0472e3b57893ef200">More...</a><br /></td></tr>
<tr class="separator:a8c41cf242b2ad8c0472e3b57893ef200"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b7982e6ea32e8653ae0543ff0a81354"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html">CommandLineParser</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a1b7982e6ea32e8653ae0543ff0a81354">operator=</a> (const <a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html">CommandLineParser</a> &amp;parser)</td></tr>
<tr class="memdesc:a1b7982e6ea32e8653ae0543ff0a81354"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assignment operator.  <a href="#a1b7982e6ea32e8653ae0543ff0a81354">More...</a><br /></td></tr>
<tr class="separator:a1b7982e6ea32e8653ae0543ff0a81354"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70c31969ec5259b8c093d11a80c34f9f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a70c31969ec5259b8c093d11a80c34f9f">printErrors</a> () const</td></tr>
<tr class="memdesc:a70c31969ec5259b8c093d11a80c34f9f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print list of errors occurred.  <a href="#a70c31969ec5259b8c093d11a80c34f9f">More...</a><br /></td></tr>
<tr class="separator:a70c31969ec5259b8c093d11a80c34f9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a84cda3794b765332bfe43bf8367222fb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a84cda3794b765332bfe43bf8367222fb">printMessage</a> () const</td></tr>
<tr class="memdesc:a84cda3794b765332bfe43bf8367222fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print help message.  <a href="#a84cda3794b765332bfe43bf8367222fb">More...</a><br /></td></tr>
<tr class="separator:a84cda3794b765332bfe43bf8367222fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a5bbf3174ab2291e3643be49f5cfb09e6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a5bbf3174ab2291e3643be49f5cfb09e6">getByIndex</a> (int index, bool space_delete, <a class="el" href="../../dc/d84/group__core__basic.html#ga8af2ae1e077644d1dd232d29d988b79a">Param</a> type, void *dst) const</td></tr>
<tr class="separator:a5bbf3174ab2291e3643be49f5cfb09e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aafea72a2d5d225a40e78679cdc89cefb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#aafea72a2d5d225a40e78679cdc89cefb">getByName</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;name, bool space_delete, <a class="el" href="../../dc/d84/group__core__basic.html#ga8af2ae1e077644d1dd232d29d988b79a">Param</a> type, void *dst) const</td></tr>
<tr class="separator:aafea72a2d5d225a40e78679cdc89cefb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a4f1f41fd43c10f0fd10e631f5dc60b6c"><td class="memItemLeft" align="right" valign="top">Impl *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a4f1f41fd43c10f0fd10e631f5dc60b6c">impl</a></td></tr>
<tr class="separator:a4f1f41fd43c10f0fd10e631f5dc60b6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Designed for command line parsing. </p>
<p>The sample below demonstrates how to use <a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html" title="Designed for command line parsing. ">CommandLineParser</a>: </p><div class="fragment"><div class="line"><a class="code" href="../../d0/d2e/classcv_1_1CommandLineParser.html#ad0bb71c0bc9800e90bfdc44ff406293e">CommandLineParser</a> parser(argc, argv, keys);</div><div class="line">parser.about(<span class="stringliteral">&quot;Application name v1.0.0&quot;</span>);</div><div class="line"></div><div class="line"><span class="keywordflow">if</span> (parser.has(<span class="stringliteral">&quot;help&quot;</span>))</div><div class="line">{</div><div class="line">    parser.printMessage();</div><div class="line">    <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> N = parser.get&lt;<span class="keywordtype">int</span>&gt;(<span class="stringliteral">&quot;N&quot;</span>);</div><div class="line"><span class="keywordtype">double</span> fps = parser.get&lt;<span class="keywordtype">double</span>&gt;(<span class="stringliteral">&quot;fps&quot;</span>);</div><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> path = parser.get&lt;<a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>&gt;(<span class="stringliteral">&quot;path&quot;</span>);</div><div class="line"></div><div class="line">use_time_stamp = parser.has(<span class="stringliteral">&quot;timestamp&quot;</span>);</div><div class="line"></div><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> img1 = parser.get&lt;<a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>&gt;(0);</div><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> img2 = parser.get&lt;<a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>&gt;(1);</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> <a class="code" href="../../d2/de8/group__core__array.html#ga496c3860f3ac44c40b48811333cfda2d">repeat</a> = parser.get&lt;<span class="keywordtype">int</span>&gt;(2);</div><div class="line"></div><div class="line"><span class="keywordflow">if</span> (!parser.check())</div><div class="line">{</div><div class="line">    parser.printErrors();</div><div class="line">    <span class="keywordflow">return</span> 0;</div><div class="line">}</div></div><!-- fragment --><h3>Keys syntax</h3>
<p>The keys parameter is a string containing several blocks, each one is enclosed in curly braces and describes one argument. Each argument contains three parts separated by the <code>|</code> symbol:</p>
<ol type="1">
<li>argument names is a space-separated list of option synonyms (to mark argument as positional, prefix it with the <code>@</code> symbol)</li>
<li>default value will be used if the argument was not provided (can be empty)</li>
<li>help message (can be empty)</li>
</ol>
<p>For example:</p>
<div class="fragment"><div class="line">    <span class="keyword">const</span> <a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> keys =</div><div class="line">        <span class="stringliteral">&quot;{help h usage ? |      | print this message   }&quot;</span></div><div class="line">        <span class="stringliteral">&quot;{@image1        |      | image1 for compare   }&quot;</span></div><div class="line">        <span class="stringliteral">&quot;{@image2        |&lt;none&gt;| image2 for compare   }&quot;</span></div><div class="line">        <span class="stringliteral">&quot;{@repeat        |1     | number               }&quot;</span></div><div class="line">        <span class="stringliteral">&quot;{path           |.     | path to file         }&quot;</span></div><div class="line">        <span class="stringliteral">&quot;{fps            | -1.0 | fps for output video }&quot;</span></div><div class="line">        <span class="stringliteral">&quot;{N count        |100   | count of objects     }&quot;</span></div><div class="line">        <span class="stringliteral">&quot;{ts timestamp   |      | use time stamp       }&quot;</span></div><div class="line">        ;</div><div class="line">}</div></div><!-- fragment --><p>Note that there are no default values for <code>help</code> and <code>timestamp</code> so we can check their presence using the <code><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a8c41cf242b2ad8c0472e3b57893ef200" title="Check if field was provided in the command line. ">has()</a></code> method. Arguments with default values are considered to be always present. Use the <code><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a190215863579a6d244dccfd261ee0224" title="Access arguments by name. ">get()</a></code> method in these cases to check their actual value instead.</p>
<p>String keys like <code>get&lt;String&gt;("@image1")</code> return the empty string <code>""</code> by default - even with an empty default value. Use the special <code>&lt;none&gt;</code> default value to enforce that the returned string must not be empty. (like in <code>get&lt;String&gt;("@image2")</code>)</p>
<h3>Usage</h3>
<p>For the described keys:</p>
<div class="fragment"><div class="line"># Good call (3 positional parameters: image1, image2 and repeat; N is 200, ts is true)</div><div class="line">$ ./app -N=200 1.png 2.jpg 19 -ts</div><div class="line"></div><div class="line"># Bad call</div><div class="line">$ ./app -fps=aaa</div><div class="line">ERRORS:</div><div class="line">Parameter &#39;fps&#39;: can not convert: [aaa] to [double]</div></div><!-- fragment --> <dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d1/d9e/fld_lines_8cpp-example.html#_a0">fld_lines.cpp</a>, <a class="el" href="../../d0/d38/modules_2shape_2samples_2shape_example_8cpp-example.html#_a6">modules/shape/samples/shape_example.cpp</a>, <a class="el" href="../../d6/d7f/samples_2cpp_2camshiftdemo_8cpp-example.html#_a18">samples/cpp/camshiftdemo.cpp</a>, <a class="el" href="../../de/d01/samples_2cpp_2connected_components_8cpp-example.html#_a9">samples/cpp/connected_components.cpp</a>, <a class="el" href="../../da/d32/samples_2cpp_2contours2_8cpp-example.html#_a8">samples/cpp/contours2.cpp</a>, <a class="el" href="../../d5/d04/samples_2cpp_2convexhull_8cpp-example.html#_a0">samples/cpp/convexhull.cpp</a>, <a class="el" href="../../d9/d15/samples_2cpp_2cout_mat_8cpp-example.html#_a0">samples/cpp/cout_mat.cpp</a>, <a class="el" href="../../db/d75/samples_2cpp_2create_mask_8cpp-example.html#_a20">samples/cpp/create_mask.cpp</a>, <a class="el" href="../../da/d53/samples_2cpp_2demhist_8cpp-example.html#_a17">samples/cpp/demhist.cpp</a>, <a class="el" href="../../d4/dc6/samples_2cpp_2distrans_8cpp-example.html#_a17">samples/cpp/distrans.cpp</a>, <a class="el" href="../../d6/d56/samples_2cpp_2edge_8cpp-example.html#_a9">samples/cpp/edge.cpp</a>, <a class="el" href="../../d4/d26/samples_2cpp_2facedetect_8cpp-example.html#_a5">samples/cpp/facedetect.cpp</a>, <a class="el" href="../../d1/d17/samples_2cpp_2ffilldemo_8cpp-example.html#_a14">samples/cpp/ffilldemo.cpp</a>, <a class="el" href="../../d2/dfd/samples_2cpp_2filestorage_8cpp-example.html#_a7">samples/cpp/filestorage.cpp</a>, <a class="el" href="../../d9/d73/samples_2cpp_2fitellipse_8cpp-example.html#_a36">samples/cpp/fitellipse.cpp</a>, <a class="el" href="../../d8/d34/samples_2cpp_2grabcut_8cpp-example.html#_a39">samples/cpp/grabcut.cpp</a>, <a class="el" href="../../dd/d93/samples_2cpp_2image_alignment_8cpp-example.html#_a17">samples/cpp/image_alignment.cpp</a>, <a class="el" href="../../d6/ddf/samples_2cpp_2laplace_8cpp-example.html#_a0">samples/cpp/laplace.cpp</a>, <a class="el" href="../../d2/d1d/samples_2cpp_2lkdemo_8cpp-example.html#_a9">samples/cpp/lkdemo.cpp</a>, <a class="el" href="../../d3/db0/samples_2cpp_2pca_8cpp-example.html#_a19">samples/cpp/pca.cpp</a>, <a class="el" href="../../df/d54/samples_2cpp_2peopledetect_8cpp-example.html#_a13">samples/cpp/peopledetect.cpp</a>, <a class="el" href="../../d4/d35/samples_2cpp_2polar_transforms_8cpp-example.html#_a2">samples/cpp/polar_transforms.cpp</a>, <a class="el" href="../../d5/de8/samples_2cpp_2segment_objects_8cpp-example.html#_a16">samples/cpp/segment_objects.cpp</a>, <a class="el" href="../../d0/df8/samples_2cpp_2train_HOG_8cpp-example.html#_a47">samples/cpp/train_HOG.cpp</a>, <a class="el" href="../../de/d45/samples_2cpp_2tutorial_code_2features2D_2Homography_2decompose_homography_8cpp-example.html#_a24">samples/cpp/tutorial_code/features2D/Homography/decompose_homography.cpp</a>, <a class="el" href="../../d9/d47/samples_2cpp_2tutorial_code_2features2D_2Homography_2homography_from_camera_displacement_8cpp-example.html#_a29">samples/cpp/tutorial_code/features2D/Homography/homography_from_camera_displacement.cpp</a>, <a class="el" href="../../d0/d92/samples_2cpp_2tutorial_code_2features2D_2Homography_2pose_from_homography_8cpp-example.html#_a29">samples/cpp/tutorial_code/features2D/Homography/pose_from_homography.cpp</a>, <a class="el" href="../../df/d5e/samples_2cpp_2tutorial_code_2ImgProc_2Morphology_1_8cpp-example.html#_a1">samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp</a>, <a class="el" href="../../da/d34/samples_2cpp_2tutorial_code_2ImgProc_2Morphology_2_8cpp-example.html#_a1">samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp</a>, <a class="el" href="../../d3/d94/samples_2cpp_2tutorial_code_2ImgTrans_2Sobel_Demo_8cpp-example.html#_a0">samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp</a>, <a class="el" href="../../da/d94/samples_2cpp_2tutorial_code_2ml_2introduction_to_pca_2introduction_to_pca_8cpp-example.html#_a22">samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp</a>, <a class="el" href="../../de/dd9/samples_2cpp_2tutorial_code_2photo_2non_photorealistic_rendering_2npr_demo_8cpp-example.html#_a0">samples/cpp/tutorial_code/photo/non_photorealistic_rendering/npr_demo.cpp</a>, <a class="el" href="../../de/dd4/samples_2cpp_2warpPerspective_demo_8cpp-example.html#_a3">samples/cpp/warpPerspective_demo.cpp</a>, <a class="el" href="../../d4/d40/samples_2cpp_2watershed_8cpp-example.html#_a13">samples/cpp/watershed.cpp</a>, <a class="el" href="../../d9/d8d/samples_2dnn_2classification_8cpp-example.html#_a0">samples/dnn/classification.cpp</a>, <a class="el" href="../../d6/d39/samples_2dnn_2colorization_8cpp-example.html#_a0">samples/dnn/colorization.cpp</a>, <a class="el" href="../../d4/db9/samples_2dnn_2object_detection_8cpp-example.html#_a8">samples/dnn/object_detection.cpp</a>, <a class="el" href="../../d7/d4f/samples_2dnn_2openpose_8cpp-example.html#_a0">samples/dnn/openpose.cpp</a>, <a class="el" href="../../d4/d88/samples_2dnn_2segmentation_8cpp-example.html#_a1">samples/dnn/segmentation.cpp</a>, <a class="el" href="../../db/da4/samples_2dnn_2text_detection_8cpp-example.html#_a2">samples/dnn/text_detection.cpp</a>, <a class="el" href="../../d8/d61/samples_2tapi_2hog_8cpp-example.html#_a0">samples/tapi/hog.cpp</a>, and <a class="el" href="../../de/dc0/samples_2tapi_2squares_8cpp-example.html#_a35">samples/tapi/squares.cpp</a>.</dd>
</dl></div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ad0bb71c0bc9800e90bfdc44ff406293e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad0bb71c0bc9800e90bfdc44ff406293e">&#9670;&nbsp;</a></span>CommandLineParser() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cv::CommandLineParser::CommandLineParser </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>argv</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;&#160;</td>
          <td class="paramname"><em>keys</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor. </p>
<p>Initializes command line parser object</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">argc</td><td>number of command line arguments (from main()) </td></tr>
    <tr><td class="paramname">argv</td><td>array of command line arguments (from main()) </td></tr>
    <tr><td class="paramname">keys</td><td>string describing acceptable command line parameters (see class description for syntax) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a614095229293b2ab780cadd41a83313a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a614095229293b2ab780cadd41a83313a">&#9670;&nbsp;</a></span>CommandLineParser() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cv::CommandLineParser::CommandLineParser </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html">CommandLineParser</a> &amp;&#160;</td>
          <td class="paramname"><em>parser</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Copy constructor. </p>

</div>
</div>
<a id="a92bf68d8b036aad6164d1a5ee51ded01"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a92bf68d8b036aad6164d1a5ee51ded01">&#9670;&nbsp;</a></span>~CommandLineParser()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cv::CommandLineParser::~CommandLineParser </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destructor. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a2e11e779047efded23f75d9c5c5dd82e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2e11e779047efded23f75d9c5c5dd82e">&#9670;&nbsp;</a></span>about()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::CommandLineParser::about </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;&#160;</td>
          <td class="paramname"><em>message</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the about message. </p>
<p>The about message will be shown when <a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a84cda3794b765332bfe43bf8367222fb">printMessage</a> is called, right before arguments table. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../de/d01/samples_2cpp_2connected_components_8cpp-example.html#a10">samples/cpp/connected_components.cpp</a>, <a class="el" href="../../da/d53/samples_2cpp_2demhist_8cpp-example.html#a18">samples/cpp/demhist.cpp</a>, <a class="el" href="../../df/d54/samples_2cpp_2peopledetect_8cpp-example.html#a14">samples/cpp/peopledetect.cpp</a>, <a class="el" href="../../d4/d35/samples_2cpp_2polar_transforms_8cpp-example.html#a3">samples/cpp/polar_transforms.cpp</a>, <a class="el" href="../../de/d45/samples_2cpp_2tutorial_code_2features2D_2Homography_2decompose_homography_8cpp-example.html#a26">samples/cpp/tutorial_code/features2D/Homography/decompose_homography.cpp</a>, <a class="el" href="../../d9/d47/samples_2cpp_2tutorial_code_2features2D_2Homography_2homography_from_camera_displacement_8cpp-example.html#a31">samples/cpp/tutorial_code/features2D/Homography/homography_from_camera_displacement.cpp</a>, <a class="el" href="../../d0/d92/samples_2cpp_2tutorial_code_2features2D_2Homography_2pose_from_homography_8cpp-example.html#a31">samples/cpp/tutorial_code/features2D/Homography/pose_from_homography.cpp</a>, and <a class="el" href="../../d9/d8d/samples_2dnn_2classification_8cpp-example.html#a2">samples/dnn/classification.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ad6b244a52f3b90da6fc463341c8a486f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad6b244a52f3b90da6fc463341c8a486f">&#9670;&nbsp;</a></span>check()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cv::CommandLineParser::check </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check for parsing errors. </p>
<p>Returns false if error occurred while accessing the parameters (bad conversion, missing arguments, etc.). Call <a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a70c31969ec5259b8c093d11a80c34f9f">printErrors</a> to print error messages list. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d0/d38/modules_2shape_2samples_2shape_example_8cpp-example.html#a9">modules/shape/samples/shape_example.cpp</a>, <a class="el" href="../../d4/d26/samples_2cpp_2facedetect_8cpp-example.html#a8">samples/cpp/facedetect.cpp</a>, <a class="el" href="../../d6/ddf/samples_2cpp_2laplace_8cpp-example.html#a11">samples/cpp/laplace.cpp</a>, <a class="el" href="../../df/d54/samples_2cpp_2peopledetect_8cpp-example.html#a18">samples/cpp/peopledetect.cpp</a>, and <a class="el" href="../../d9/d8d/samples_2dnn_2classification_8cpp-example.html#a13">samples/dnn/classification.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="a190215863579a6d244dccfd261ee0224"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a190215863579a6d244dccfd261ee0224">&#9670;&nbsp;</a></span>get() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">T cv::CommandLineParser::get </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>space_delete</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Access arguments by name. </p>
<p>Returns argument converted to selected type. If the argument is not known or can not be converted to selected type, the error flag is set (can be checked with <a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#ad6b244a52f3b90da6fc463341c8a486f">check</a>).</p>
<p>For example, define: </p><div class="fragment"><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> keys = <span class="stringliteral">&quot;{N count||}&quot;</span>;</div></div><!-- fragment --><p>Call: </p><div class="fragment"><div class="line">$ ./my-app -N=20</div><div class="line"># or</div><div class="line">$ ./my-app --count=20</div></div><!-- fragment --><p>Access: </p><div class="fragment"><div class="line"><span class="keywordtype">int</span> N = parser.get&lt;<span class="keywordtype">int</span>&gt;(<span class="stringliteral">&quot;N&quot;</span>);</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>name of the argument </td></tr>
    <tr><td class="paramname">space_delete</td><td>remove spaces from the left and right of the string </td></tr>
  </table>
  </dd>
</dl>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">T</td><td>the argument will be converted to this type if possible</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>You can access positional arguments by their <code>@</code>-prefixed name: <div class="fragment"><div class="line">parser.get&lt;<a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>&gt;(<span class="stringliteral">&quot;@image&quot;</span>);</div></div><!-- fragment --> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d1/d9e/fld_lines_8cpp-example.html#a4">fld_lines.cpp</a>, <a class="el" href="../../d0/d38/modules_2shape_2samples_2shape_example_8cpp-example.html#a8">modules/shape/samples/shape_example.cpp</a>, <a class="el" href="../../d6/d7f/samples_2cpp_2camshiftdemo_8cpp-example.html#a20">samples/cpp/camshiftdemo.cpp</a>, <a class="el" href="../../de/d01/samples_2cpp_2connected_components_8cpp-example.html#a12">samples/cpp/connected_components.cpp</a>, <a class="el" href="../../da/d53/samples_2cpp_2demhist_8cpp-example.html#a21">samples/cpp/demhist.cpp</a>, <a class="el" href="../../d4/dc6/samples_2cpp_2distrans_8cpp-example.html#a19">samples/cpp/distrans.cpp</a>, <a class="el" href="../../d6/d56/samples_2cpp_2edge_8cpp-example.html#a10">samples/cpp/edge.cpp</a>, <a class="el" href="../../d4/d26/samples_2cpp_2facedetect_8cpp-example.html#a7">samples/cpp/facedetect.cpp</a>, <a class="el" href="../../d1/d17/samples_2cpp_2ffilldemo_8cpp-example.html#a17">samples/cpp/ffilldemo.cpp</a>, <a class="el" href="../../d2/dfd/samples_2cpp_2filestorage_8cpp-example.html#a9">samples/cpp/filestorage.cpp</a>, <a class="el" href="../../d9/d73/samples_2cpp_2fitellipse_8cpp-example.html#a38">samples/cpp/fitellipse.cpp</a>, <a class="el" href="../../d8/d34/samples_2cpp_2grabcut_8cpp-example.html#a40">samples/cpp/grabcut.cpp</a>, <a class="el" href="../../d6/ddf/samples_2cpp_2laplace_8cpp-example.html#a2">samples/cpp/laplace.cpp</a>, <a class="el" href="../../d2/d1d/samples_2cpp_2lkdemo_8cpp-example.html#a10">samples/cpp/lkdemo.cpp</a>, <a class="el" href="../../d3/db0/samples_2cpp_2pca_8cpp-example.html#a22">samples/cpp/pca.cpp</a>, <a class="el" href="../../df/d54/samples_2cpp_2peopledetect_8cpp-example.html#a17">samples/cpp/peopledetect.cpp</a>, <a class="el" href="../../d4/d35/samples_2cpp_2polar_transforms_8cpp-example.html#a5">samples/cpp/polar_transforms.cpp</a>, <a class="el" href="../../d5/de8/samples_2cpp_2segment_objects_8cpp-example.html#a18">samples/cpp/segment_objects.cpp</a>, <a class="el" href="../../de/d45/samples_2cpp_2tutorial_code_2features2D_2Homography_2decompose_homography_8cpp-example.html#a28">samples/cpp/tutorial_code/features2D/Homography/decompose_homography.cpp</a>, <a class="el" href="../../d9/d47/samples_2cpp_2tutorial_code_2features2D_2Homography_2homography_from_camera_displacement_8cpp-example.html#a33">samples/cpp/tutorial_code/features2D/Homography/homography_from_camera_displacement.cpp</a>, <a class="el" href="../../d0/d92/samples_2cpp_2tutorial_code_2features2D_2Homography_2pose_from_homography_8cpp-example.html#a33">samples/cpp/tutorial_code/features2D/Homography/pose_from_homography.cpp</a>, <a class="el" href="../../d3/d94/samples_2cpp_2tutorial_code_2ImgTrans_2Sobel_Demo_8cpp-example.html#a3">samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp</a>, <a class="el" href="../../de/dd9/samples_2cpp_2tutorial_code_2photo_2non_photorealistic_rendering_2npr_demo_8cpp-example.html#a4">samples/cpp/tutorial_code/photo/non_photorealistic_rendering/npr_demo.cpp</a>, <a class="el" href="../../de/dd4/samples_2cpp_2warpPerspective_demo_8cpp-example.html#a5">samples/cpp/warpPerspective_demo.cpp</a>, <a class="el" href="../../d4/d40/samples_2cpp_2watershed_8cpp-example.html#a16">samples/cpp/watershed.cpp</a>, <a class="el" href="../../d9/d8d/samples_2dnn_2classification_8cpp-example.html#a1">samples/dnn/classification.cpp</a>, <a class="el" href="../../d7/d4f/samples_2dnn_2openpose_8cpp-example.html#a2">samples/dnn/openpose.cpp</a>, <a class="el" href="../../d8/d61/samples_2tapi_2hog_8cpp-example.html#a6">samples/tapi/hog.cpp</a>, and <a class="el" href="../../de/dc0/samples_2tapi_2squares_8cpp-example.html#a40">samples/tapi/squares.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="a60f2b13d84edfc54aed723fb170478b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a60f2b13d84edfc54aed723fb170478b9">&#9670;&nbsp;</a></span>get() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">T cv::CommandLineParser::get </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>space_delete</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Access positional arguments by index. </p>
<p>Returns argument converted to selected type. Indexes are counted from zero.</p>
<p>For example, define: </p><div class="fragment"><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> keys = <span class="stringliteral">&quot;{@arg1||}{@arg2||}&quot;</span></div></div><!-- fragment --><p>Call: </p><div class="fragment"><div class="line">./my-app abc qwe</div></div><!-- fragment --><p>Access arguments: </p><div class="fragment"><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> val_1 = parser.get&lt;<a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>&gt;(0); <span class="comment">// returns &quot;abc&quot;, arg1</span></div><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> val_2 = parser.get&lt;<a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>&gt;(1); <span class="comment">// returns &quot;qwe&quot;, arg2</span></div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">index</td><td>index of the argument </td></tr>
    <tr><td class="paramname">space_delete</td><td>remove spaces from the left and right of the string </td></tr>
  </table>
  </dd>
</dl>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">T</td><td>the argument will be converted to this type if possible </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a5bbf3174ab2291e3643be49f5cfb09e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5bbf3174ab2291e3643be49f5cfb09e6">&#9670;&nbsp;</a></span>getByIndex()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void cv::CommandLineParser::getByIndex </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>space_delete</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga8af2ae1e077644d1dd232d29d988b79a">Param</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="aafea72a2d5d225a40e78679cdc89cefb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aafea72a2d5d225a40e78679cdc89cefb">&#9670;&nbsp;</a></span>getByName()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void cv::CommandLineParser::getByName </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>space_delete</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga8af2ae1e077644d1dd232d29d988b79a">Param</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a19086a9bc59b7e3d943ea13b0a9fcb7e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a19086a9bc59b7e3d943ea13b0a9fcb7e">&#9670;&nbsp;</a></span>getPathToApplication()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> cv::CommandLineParser::getPathToApplication </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns application path. </p>
<p>This method returns the path to the executable from the command line (<code>argv[0]</code>).</p>
<p>For example, if the application has been started with such a command: </p><div class="fragment"><div class="line">$ ./bin/my-executable</div></div><!-- fragment --><p> this method will return <code>./bin</code>. </p>

</div>
</div>
<a id="a8c41cf242b2ad8c0472e3b57893ef200"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8c41cf242b2ad8c0472e3b57893ef200">&#9670;&nbsp;</a></span>has()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cv::CommandLineParser::has </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check if field was provided in the command line. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>argument name to check </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d1/d9e/fld_lines_8cpp-example.html#a1">fld_lines.cpp</a>, <a class="el" href="../../d0/d38/modules_2shape_2samples_2shape_example_8cpp-example.html#a7">modules/shape/samples/shape_example.cpp</a>, <a class="el" href="../../d6/d7f/samples_2cpp_2camshiftdemo_8cpp-example.html#a19">samples/cpp/camshiftdemo.cpp</a>, <a class="el" href="../../da/d32/samples_2cpp_2contours2_8cpp-example.html#a9">samples/cpp/contours2.cpp</a>, <a class="el" href="../../d5/d04/samples_2cpp_2convexhull_8cpp-example.html#a1">samples/cpp/convexhull.cpp</a>, <a class="el" href="../../d9/d15/samples_2cpp_2cout_mat_8cpp-example.html#a1">samples/cpp/cout_mat.cpp</a>, <a class="el" href="../../da/d53/samples_2cpp_2demhist_8cpp-example.html#a19">samples/cpp/demhist.cpp</a>, <a class="el" href="../../d4/dc6/samples_2cpp_2distrans_8cpp-example.html#a18">samples/cpp/distrans.cpp</a>, <a class="el" href="../../d4/d26/samples_2cpp_2facedetect_8cpp-example.html#a6">samples/cpp/facedetect.cpp</a>, <a class="el" href="../../d1/d17/samples_2cpp_2ffilldemo_8cpp-example.html#a15">samples/cpp/ffilldemo.cpp</a>, <a class="el" href="../../d2/dfd/samples_2cpp_2filestorage_8cpp-example.html#a8">samples/cpp/filestorage.cpp</a>, <a class="el" href="../../d9/d73/samples_2cpp_2fitellipse_8cpp-example.html#a37">samples/cpp/fitellipse.cpp</a>, <a class="el" href="../../d6/ddf/samples_2cpp_2laplace_8cpp-example.html#a10">samples/cpp/laplace.cpp</a>, <a class="el" href="../../d3/db0/samples_2cpp_2pca_8cpp-example.html#a20">samples/cpp/pca.cpp</a>, <a class="el" href="../../df/d54/samples_2cpp_2peopledetect_8cpp-example.html#a15">samples/cpp/peopledetect.cpp</a>, <a class="el" href="../../d5/de8/samples_2cpp_2segment_objects_8cpp-example.html#a17">samples/cpp/segment_objects.cpp</a>, <a class="el" href="../../de/d45/samples_2cpp_2tutorial_code_2features2D_2Homography_2decompose_homography_8cpp-example.html#a25">samples/cpp/tutorial_code/features2D/Homography/decompose_homography.cpp</a>, <a class="el" href="../../d9/d47/samples_2cpp_2tutorial_code_2features2D_2Homography_2homography_from_camera_displacement_8cpp-example.html#a30">samples/cpp/tutorial_code/features2D/Homography/homography_from_camera_displacement.cpp</a>, <a class="el" href="../../d0/d92/samples_2cpp_2tutorial_code_2features2D_2Homography_2pose_from_homography_8cpp-example.html#a30">samples/cpp/tutorial_code/features2D/Homography/pose_from_homography.cpp</a>, <a class="el" href="../../d4/d40/samples_2cpp_2watershed_8cpp-example.html#a14">samples/cpp/watershed.cpp</a>, <a class="el" href="../../d9/d8d/samples_2dnn_2classification_8cpp-example.html#a3">samples/dnn/classification.cpp</a>, <a class="el" href="../../d8/d61/samples_2tapi_2hog_8cpp-example.html#a2">samples/tapi/hog.cpp</a>, and <a class="el" href="../../de/dc0/samples_2tapi_2squares_8cpp-example.html#a36">samples/tapi/squares.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="a1b7982e6ea32e8653ae0543ff0a81354"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1b7982e6ea32e8653ae0543ff0a81354">&#9670;&nbsp;</a></span>operator=()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html">CommandLineParser</a>&amp; cv::CommandLineParser::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html">CommandLineParser</a> &amp;&#160;</td>
          <td class="paramname"><em>parser</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Assignment operator. </p>

</div>
</div>
<a id="a70c31969ec5259b8c093d11a80c34f9f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a70c31969ec5259b8c093d11a80c34f9f">&#9670;&nbsp;</a></span>printErrors()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::CommandLineParser::printErrors </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Print list of errors occurred. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#ad6b244a52f3b90da6fc463341c8a486f" title="Check for parsing errors. ">check</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d0/d38/modules_2shape_2samples_2shape_example_8cpp-example.html#a10">modules/shape/samples/shape_example.cpp</a>, <a class="el" href="../../d4/d26/samples_2cpp_2facedetect_8cpp-example.html#a9">samples/cpp/facedetect.cpp</a>, <a class="el" href="../../d6/ddf/samples_2cpp_2laplace_8cpp-example.html#a12">samples/cpp/laplace.cpp</a>, <a class="el" href="../../df/d54/samples_2cpp_2peopledetect_8cpp-example.html#a19">samples/cpp/peopledetect.cpp</a>, and <a class="el" href="../../d9/d8d/samples_2dnn_2classification_8cpp-example.html#a14">samples/dnn/classification.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="a84cda3794b765332bfe43bf8367222fb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a84cda3794b765332bfe43bf8367222fb">&#9670;&nbsp;</a></span>printMessage()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::CommandLineParser::printMessage </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Print help message. </p>
<p>This method will print standard help message containing the about message and arguments description.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d0/d2e/classcv_1_1CommandLineParser.html#a2e11e779047efded23f75d9c5c5dd82e" title="Set the about message. ">about</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d1/d9e/fld_lines_8cpp-example.html#a2">fld_lines.cpp</a>, <a class="el" href="../../d6/d7f/samples_2cpp_2camshiftdemo_8cpp-example.html#a23">samples/cpp/camshiftdemo.cpp</a>, <a class="el" href="../../de/d01/samples_2cpp_2connected_components_8cpp-example.html#a11">samples/cpp/connected_components.cpp</a>, <a class="el" href="../../da/d53/samples_2cpp_2demhist_8cpp-example.html#a20">samples/cpp/demhist.cpp</a>, <a class="el" href="../../d1/d17/samples_2cpp_2ffilldemo_8cpp-example.html#a16">samples/cpp/ffilldemo.cpp</a>, <a class="el" href="../../d3/db0/samples_2cpp_2pca_8cpp-example.html#a21">samples/cpp/pca.cpp</a>, <a class="el" href="../../df/d54/samples_2cpp_2peopledetect_8cpp-example.html#a16">samples/cpp/peopledetect.cpp</a>, <a class="el" href="../../d4/d35/samples_2cpp_2polar_transforms_8cpp-example.html#a4">samples/cpp/polar_transforms.cpp</a>, <a class="el" href="../../de/d45/samples_2cpp_2tutorial_code_2features2D_2Homography_2decompose_homography_8cpp-example.html#a27">samples/cpp/tutorial_code/features2D/Homography/decompose_homography.cpp</a>, <a class="el" href="../../d9/d47/samples_2cpp_2tutorial_code_2features2D_2Homography_2homography_from_camera_displacement_8cpp-example.html#a32">samples/cpp/tutorial_code/features2D/Homography/homography_from_camera_displacement.cpp</a>, <a class="el" href="../../d0/d92/samples_2cpp_2tutorial_code_2features2D_2Homography_2pose_from_homography_8cpp-example.html#a32">samples/cpp/tutorial_code/features2D/Homography/pose_from_homography.cpp</a>, <a class="el" href="../../d3/d94/samples_2cpp_2tutorial_code_2ImgTrans_2Sobel_Demo_8cpp-example.html#a1">samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp</a>, <a class="el" href="../../d9/d8d/samples_2dnn_2classification_8cpp-example.html#a4">samples/dnn/classification.cpp</a>, <a class="el" href="../../d7/d4f/samples_2dnn_2openpose_8cpp-example.html#a4">samples/dnn/openpose.cpp</a>, <a class="el" href="../../d8/d61/samples_2tapi_2hog_8cpp-example.html#a3">samples/tapi/hog.cpp</a>, and <a class="el" href="../../de/dc0/samples_2tapi_2squares_8cpp-example.html#a37">samples/tapi/squares.cpp</a>.</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a4f1f41fd43c10f0fd10e631f5dc60b6c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4f1f41fd43c10f0fd10e631f5dc60b6c">&#9670;&nbsp;</a></span>impl</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Impl* cv::CommandLineParser::impl</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>opencv2/core/<a class="el" href="../../d1/d4e/utility_8hpp.html">utility.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:42 for OpenCV by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
